package cn.readjava.bean;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

@Entity
public class Video implements Serializable {
    private long videoId;
    private Long videoTypeId;
    private String videoTitle;
    private String videoUrl;
    private Integer videoState;
    private String videoIcon;

    @Id
    @Column(name = "video_id", nullable = false)
    public long getVideoId() {
        return videoId;
    }

    public void setVideoId(long videoId) {
        this.videoId = videoId;
    }

    @Basic
    @Column(name = "video_type_id", nullable = true)
    public Long getVideoTypeId() {
        return videoTypeId;
    }

    public void setVideoTypeId(Long videoTypeId) {
        this.videoTypeId = videoTypeId;
    }

    @Basic
    @Column(name = "video_title", nullable = true, length = 255)
    public String getVideoTitle() {
        return videoTitle;
    }

    public void setVideoTitle(String videoTitle) {
        this.videoTitle = videoTitle;
    }

    @Basic
    @Column(name = "video_url", nullable = true, length = 255)
    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    @Basic
    @Column(name = "video_state", nullable = true)
    public Integer getVideoState() {
        return videoState;
    }

    public void setVideoState(Integer videoState) {
        this.videoState = videoState;
    }

    @Basic
    @Column(name = "video_icon", nullable = true, length = 255)
    public String getVideoIcon() {
        return videoIcon;
    }

    public void setVideoIcon(String videoIcon) {
        this.videoIcon = videoIcon;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Video video = (Video) o;
        return videoId == video.videoId &&
                Objects.equals(videoTypeId, video.videoTypeId) &&
                Objects.equals(videoTitle, video.videoTitle) &&
                Objects.equals(videoUrl, video.videoUrl) &&
                Objects.equals(videoState, video.videoState) &&
                Objects.equals(videoIcon, video.videoIcon);
    }

    @Override
    public int hashCode() {

        return Objects.hash(videoId, videoTypeId, videoTitle, videoUrl, videoState, videoIcon);
    }
}
